doctype html
html(lang='en')
  head
    title='Segment Annotations'
    meta(charset= "UTF-8")
    - baseUrl = baseUrl || ''
    link(rel='stylesheet', href='//cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css')
    link(rel='stylesheet', href='//cdn.datatables.net/buttons/1.2.2/css/buttons.dataTables.min.css')
    link(rel='stylesheet', href='//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css')
    link(rel='stylesheet', href='//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css')
    link(rel='stylesheet', href='//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.min.css')
    link(rel='stylesheet', href='//cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.4/css/selectize.css')
    link(rel='stylesheet', href=`${baseUrl}/client/js/vendor/datatables.editor/css/editor.dataTables.min.css`)
    link(rel='stylesheet', href=`${baseUrl}/client/js/vendor/datatables.editor/css/editor.selectize.css`)
    link(rel='stylesheet', href=`${baseUrl}/css/fileInput.css`)
    style(type='text/css').
      div.selectize-dropdown { z-index: 101; }

  body
    #main(style='padding:10px;')
      div#topButtons
      p
      div
        table#resultTable(style='visibility:hidden')
        div#loadingMessage(style='visibility:hidden') Loading...

    // Load require.js and start the app
    script(src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js")
    script(src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js")
    script(src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js")
    script(src="//cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js")
    script(src="//cdn.datatables.net/select/1.2.0/js/dataTables.select.min.js")
    script(src="//cdn.datatables.net/buttons/1.2.2/js/dataTables.buttons.min.js")
    script(src="//cdn.datatables.net/buttons/1.2.2/js/buttons.colVis.min.js")
    script(src="//cdn.datatables.net/buttons/1.2.2/js/buttons.html5.min.js")
    script(src="//cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.4/js/standalone/selectize.js")
    script(src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js")
    script(src=`${baseUrl}/client/js/vendor/datatables.editor/js/dataTables.editor.min.js`)
    script(src=`${baseUrl}/client/js/vendor/datatables.editor/js/editor.selectize.js`)
    script(src=`${baseUrl}/js/datatables.js`)
    script(src=`${baseUrl}/client/js/apps/scan-net/AnnotationsViewer.js`)
    script.
      var viewer = new AnnotationsViewer({
        baseUrl: !{JSON.stringify(baseUrl || '')},
        resultTableSelector: '#resultTable',
        loadingMessageSelector: '#loadingMessage',
        buttonsPanel: '#topButtons'
      })
      viewer.init({
        annotations: !{JSON.stringify(annotations || null)},
        ajaxOptions: !{JSON.stringify(ajaxOptions || null)},
        groupBy: !{JSON.stringify(ajaxOptions? ajaxOptions.groupBy || null : null)}
      });
